home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Processes.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  5.7 KB  |  209 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Processes.p
  3.  
  4.      Contains:    Process Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1989-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Processes;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __PROCESSES__}
  28. {$SETC __PROCESSES__ := 1}
  29.  
  30. {$I+}
  31. {$SETC ProcessesIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __EVENTS__}
  38. {$I Events.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __FILES__}
  41. {$I Files.p}
  42. {$ENDC}
  43.  
  44.  
  45. {$PUSH}
  46. {$ALIGN MAC68K}
  47. {$LibExport+}
  48.  
  49. { type for unique process identifier }
  50.  
  51. TYPE
  52.     ProcessSerialNumberPtr = ^ProcessSerialNumber;
  53.     ProcessSerialNumber = RECORD
  54.         highLongOfPSN:            LONGINT;
  55.         lowLongOfPSN:            LONGINT;
  56.     END;
  57.  
  58.  
  59. CONST
  60.                                                                 {  Process identifier - Various reserved process serial numbers  }
  61.     kNoProcess                    = 0;
  62.     kSystemProcess                = 1;
  63.     kCurrentProcess                = 2;
  64.  
  65. { Definition of the parameter block passed to _Launch }
  66. {  Typedef and flags for launchControlFlags field }
  67.  
  68. TYPE
  69.     LaunchFlags                            = INTEGER;
  70.  
  71. CONST
  72.     launchContinue                = $4000;
  73.     launchNoFileFlags            = $0800;
  74.     launchUseMinimum            = $0400;
  75.     launchDontSwitch            = $0200;
  76.     launchAllow24Bit            = $0100;
  77.     launchInhibitDaemon            = $0080;
  78.  
  79. { Format for first AppleEvent to pass to new process.  The size of the overall
  80.   buffer variable: the message body immediately follows the messageLength }
  81.  
  82. TYPE
  83.     AppParametersPtr = ^AppParameters;
  84.     AppParameters = RECORD
  85.         theMsgEvent:            EventRecord;
  86.         eventRefCon:            LONGINT;
  87.         messageLength:            LONGINT;
  88.     END;
  89.  
  90. { Parameter block to _Launch }
  91.     LaunchParamBlockRecPtr = ^LaunchParamBlockRec;
  92.     LaunchParamBlockRec = RECORD
  93.         reserved1:                LONGINT;
  94.         reserved2:                INTEGER;
  95.         launchBlockID:            INTEGER;
  96.         launchEPBLength:        LONGINT;
  97.         launchFileFlags:        INTEGER;
  98.         launchControlFlags:        LaunchFlags;
  99.         launchAppSpec:            FSSpecPtr;
  100.         launchProcessSN:        ProcessSerialNumber;
  101.         launchPreferredSize:    LONGINT;
  102.         launchMinimumSize:        LONGINT;
  103.         launchAvailableSize:    LONGINT;
  104.         launchAppParameters:    AppParametersPtr;
  105.     END;
  106.  
  107.     LaunchPBPtr                            = ^LaunchParamBlockRec;
  108. { Set launchBlockID to extendedBlock to specify that extensions exist.
  109.  Set launchEPBLength to extendedBlockLen for compatibility.}
  110.  
  111. CONST
  112.     extendedBlock                = $4C43;                        {  'LC'  }
  113.     extendedBlockLen            = 32;
  114.  
  115.                                                                 {  Definition of the information block returned by GetProcessInformation  }
  116.     modeLaunchDontSwitch        = $00040000;
  117.     modeDeskAccessory            = $00020000;
  118.     modeMultiLaunch                = $00010000;
  119.     modeNeedSuspendResume        = $00004000;
  120.     modeCanBackground            = $00001000;
  121.     modeDoesActivateOnFGSwitch    = $00000800;
  122.     modeOnlyBackground            = $00000400;
  123.     modeGetFrontClicks            = $00000200;
  124.     modeGetAppDiedMsg            = $00000100;
  125.     mode32BitCompatible            = $00000080;
  126.     modeHighLevelEventAware        = $00000040;
  127.     modeLocalAndRemoteHLEvents    = $00000020;
  128.     modeStationeryAware            = $00000010;
  129.     modeUseTextEditServices        = $00000008;
  130.     modeDisplayManagerAware        = $00000004;
  131.  
  132. { Record returned by GetProcessInformation }
  133.  
  134. TYPE
  135.     ProcessInfoRecPtr = ^ProcessInfoRec;
  136.     ProcessInfoRec = RECORD
  137.         processInfoLength:        LONGINT;
  138.         processName:            StringPtr;
  139.         processNumber:            ProcessSerialNumber;
  140.         processType:            LONGINT;
  141.         processSignature:        OSType;
  142.         processMode:            LONGINT;
  143.         processLocation:        Ptr;
  144.         processSize:            LONGINT;
  145.         processFreeMem:            LONGINT;
  146.         processLauncher:        ProcessSerialNumber;
  147.         processLaunchDate:        LONGINT;
  148.         processActiveTime:        LONGINT;
  149.         processAppSpec:            FSSpecPtr;
  150.     END;
  151.  
  152. FUNCTION LaunchApplication(LaunchParams: LaunchPBPtr): OSErr;
  153.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  154.     INLINE $205F, $A9F2, $3E80;
  155.     {$ENDC}
  156. FUNCTION LaunchDeskAccessory({CONST}VAR pFileSpec: FSSpec; pDAName: ConstStr255Param): OSErr;
  157.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  158.     INLINE $3F3C, $0036, $A88F;
  159.     {$ENDC}
  160. FUNCTION GetCurrentProcess(VAR PSN: ProcessSerialNumber): OSErr;
  161.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  162.     INLINE $3F3C, $0037, $A88F;
  163.     {$ENDC}
  164. FUNCTION GetFrontProcess(VAR PSN: ProcessSerialNumber): OSErr;
  165.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  166.     INLINE $70FF, $2F00, $3F3C, $0039, $A88F;
  167.     {$ENDC}
  168. FUNCTION GetNextProcess(VAR PSN: ProcessSerialNumber): OSErr;
  169.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  170.     INLINE $3F3C, $0038, $A88F;
  171.     {$ENDC}
  172. FUNCTION GetProcessInformation({CONST}VAR PSN: ProcessSerialNumber; VAR info: ProcessInfoRec): OSErr;
  173.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  174.     INLINE $3F3C, $003A, $A88F;
  175.     {$ENDC}
  176. FUNCTION SetFrontProcess({CONST}VAR PSN: ProcessSerialNumber): OSErr;
  177.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  178.     INLINE $3F3C, $003B, $A88F;
  179.     {$ENDC}
  180. FUNCTION WakeUpProcess({CONST}VAR PSN: ProcessSerialNumber): OSErr;
  181.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  182.     INLINE $3F3C, $003C, $A88F;
  183.     {$ENDC}
  184. FUNCTION SameProcess({CONST}VAR PSN1: ProcessSerialNumber; {CONST}VAR PSN2: ProcessSerialNumber; VAR result: BOOLEAN): OSErr;
  185.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  186.     INLINE $3F3C, $003D, $A88F;
  187.     {$ENDC}
  188. {$IFC NOT OLDROUTINELOCATIONS }
  189. {
  190.     ExitToShell was previously in SegLoad.h
  191. }
  192. PROCEDURE ExitToShell;
  193.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  194.     INLINE $A9F4;
  195.     {$ENDC}
  196. {$ENDC}
  197.  
  198.  
  199. {$ALIGN RESET}
  200. {$POP}
  201.  
  202. {$SETC UsingIncludes := ProcessesIncludes}
  203.  
  204. {$ENDC} {__PROCESSES__}
  205.  
  206. {$IFC NOT UsingIncludes}
  207.  END.
  208. {$ENDC}
  209.